//
//  ImageDetail.m
//  LvXi_newVersion
//
//  Created by 王敏 on 16/8/17.
//  Copyright © 2016年 SJT. All rights reserved.
//

#import "ImageDetailController.h"

@interface ImageDetailController (){
    
}

@end

@implementation ImageDetailController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor blackColor];
    [self.view addSubview:self.imageView];
    self.imageView.width = self.view.width;
    self.imageView.height = self.imageView.width;
    self.imageView.center = self.view.center;
    self.imageView.userInteractionEnabled = YES;
    [self.imageView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imageViewClick:)]];
}

-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self setUpNavi];
}
-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
}
-(void)imageViewClick:(UITapGestureRecognizer*)gesture{
    [self.navigationController popViewControllerAnimated:YES];
}

-(void)setUpNavi{
//    self.navigationController.navigationBar.hidden = YES;
    UINavigationBar * navigationBar = self.navigationController.navigationBar;
    //设置导航栏透明
    UIImage * backgroundImage = [UIImage imageWithColor:[UIColor clearColor] size:CGSizeMake(ScreenWidth, 64)];
    UIImage * shadowImage = [UIImage imageWithColor:[UIColor clearColor] size:CGSizeMake(ScreenWidth, 1)];
    //隐藏导航栏底部1px的横线
    [navigationBar setBackgroundImage:backgroundImage forBarMetrics:UIBarMetricsDefault];
    [navigationBar setShadowImage:shadowImage];
    
    UIButton * backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    backButton.frame = CGRectMake(0, 0, 20, 20);
    [backButton setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:backButton];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}


@end
